package com.aplink.generic.pojo.formdesign;

import java.io.Serializable;

import android.text.TextUtils;

import com.aplink.generic.dialog.ApLinkProgressDialog;
import com.aplink.generic.dialog.SparseDialog;
import com.aplink.generic.dictionary.GenericDictionary;
import com.aplink.generic.pojo.controlspec.ControlSpec;
import com.aplink.generic.pojo.controlspec.actionbar.ActionBarSpec;
import com.aplink.generic.util.ResourcesHelper;

public class FormDesign extends GenericDictionary<String, ControlSpec>
        implements Serializable {
    private static final long serialVersionUID = 8498276770745825724L;
    private boolean hasGallery;
    private boolean hasListView;
    private boolean isAlwayLoadFirstRecord;
    private boolean isEnableNavigateDrawer;
    private SparseDialog mAlertDialog;
    private String mAnimationIn;
    private String mAnimationOut;
    private ApLinkProgressDialog mApLinkProgressDialog;
    private String mGalleryID = null;
    private InitValue mInitValue;
    private String mLayout;
    private String mListViewID = null;
    private SelectWhere mObjectLoadBy;
    private ActionBarSpec mOptionMenu;

    public FormDesign() {
        setAlertDialog(new SparseDialog());
        isEnableNavigateDrawer = true;
    }

    public ActionBarSpec getActionBar() {
        return this.mOptionMenu;
    }

    public SparseDialog getAlertDialog() {
        return this.mAlertDialog;
    }

    public String getAnimationIn() {
        return this.mAnimationIn;
    }

    public int getAnimationInID() {
        if (TextUtils.isEmpty(this.mAnimationIn)) {
            return ResourcesHelper.RESOURCE_NOT_FOUND;
        }
        return ResourcesHelper.getAnimationIdByName(this.mAnimationIn);
    }

    public String getAnimationOut() {
        return this.mAnimationOut;
    }

    public int getAnimationOutID() {
        if (TextUtils.isEmpty(this.mAnimationIn)) {
            return ResourcesHelper.RESOURCE_NOT_FOUND;
        }
        return ResourcesHelper.getAnimationIdByName(this.mAnimationOut);
    }

    public ApLinkProgressDialog getApLinkProgressDialog() {
        return this.mApLinkProgressDialog;
    }

    public String getGalleryID() {
        return this.mGalleryID;
    }

    public InitValue getInitValue() {
        return this.mInitValue;
    }

    public String getLayout() {
        return this.mLayout;
    }

    public int getLayoutID() {
        return ResourcesHelper.getLayoutIdByName(this.mLayout);
    }

    public String getListViewID() {
        return this.mListViewID;
    }

    public SelectWhere getObjectLoadBy() {
        return this.mObjectLoadBy;
    }

    public ActionBarSpec getOptionMenu() {
        return this.mOptionMenu;
    }

    public SelectWhere getSelectWhere() {
        return this.mObjectLoadBy;
    }

    public boolean hasActionBar() {
        return mOptionMenu != null;
    }

    public boolean hasOptionMenu() {
        return this.mOptionMenu != null;
    }

    public boolean isAlwayLoadFirstRecord() {
        return this.isAlwayLoadFirstRecord;
    }

    public final boolean isEnableNavigateDrawer() {
        return isEnableNavigateDrawer;
    }

    public boolean isHasGallery() {
        return this.hasGallery;
    }

    public boolean isHasListView() {
        return this.hasListView;
    }

    public void setActionBar(final ActionBarSpec optionMenu) {
        this.mOptionMenu = optionMenu;
    }

    public void setAlertDialog(final SparseDialog alertDialog) {
        this.mAlertDialog = alertDialog;
    }

    public void setAlwayLoadFirstRecord(final boolean isAlwayLoadFirstRecord) {
        this.isAlwayLoadFirstRecord = isAlwayLoadFirstRecord;
    }

    public void setAnimationIn(final String animationIn) {
        this.mAnimationIn = animationIn;
    }

    public void setAnimationOut(final String animationOut) {
        this.mAnimationOut = animationOut;
    }

    public void setApLinkProgressDialog(
            final ApLinkProgressDialog apLinkProgressDialog) {
        this.mApLinkProgressDialog = apLinkProgressDialog;
    }

    public final void setEnableNavigateDrawer(
            final boolean isEnableNavigateDrawer) {
        this.isEnableNavigateDrawer = isEnableNavigateDrawer;
    }

    public void setGalleryID(final String galleryID) {
        this.mGalleryID = galleryID;
    }

    public void setHasGallery(final boolean hasGallery) {
        this.hasGallery = hasGallery;
    }

    public void setHasListView(final boolean hasListView) {
        this.hasListView = hasListView;
    }

    public void setInitValue(final InitValue initValue) {
        this.mInitValue = initValue;
    }

    public void setLayout(final String layout) {
        this.mLayout = layout;
    }

    public void setListViewID(final String listViewID) {
        this.mListViewID = listViewID;
    }

    public void setObjectLoadBy(final SelectWhere objectLoadBy) {
        this.mObjectLoadBy = objectLoadBy;
    }

    public void setOptionMenu(final ActionBarSpec optionMenu) {
        this.mOptionMenu = optionMenu;
    }

}
